<?php
$GW4UQ7U;
goto HykWvGlEYI;
SiyWrmDPTv:
$title = '我的生成记录';
include './header.php';
if (!($islogin2 == 0x001)) {
    goto aRjQ0kciyr;
}
goto Ig01nesFN1;
aRjQ0kciyr:
goto yvWixbQ9c2;
M1S9Gt54NF:
echo 'layer/2.3/layer.js"></script>
<script src="';
echo $cdnpublic;
goto Szroh25VaU;
DIpbgv5CeT:
include '../meihe/common.php';
goto SiyWrmDPTv;
ZfasU5xqWf:
goto FdRGjii1l4;
Szroh25VaU:
echo 'clipboard.js/1.7.1/clipboard.min.js"></script>
<script>
function addduanl(){
     var longurl=$("input[name=\'url\']").val();
     var sbm=$("input[name=\'sbm\']").val();
     var api = $("select[name=\'api\']").val();
     var type = $("select[name=\'type\']").val();
     var title = $("input[name=\'bt\']").val();
     if (!longurl) {
                layer.msg(\'URL地址不能空！\', {
                        shade: [0.8, \'#393D49\'],
                        shadeClose:true,
                        icon: 7,
                        anim: 6
                    });
                    return false;
                };
                if (!api) {
                layer.msg(\'请选择方式类型！\', {
                        shade: [0.8, \'#393D49\'],
                        shadeClose:true,
                        icon: 7,
                        anim: 6
                    });
                    return false;
                };
                if (!type) {
                layer.msg(\'请选择短链类型！\', {
                        shade: [0.8, \'#393D49\'],
                        shadeClose:true,
                        icon: 7,
                        anim: 6
                    });
                    return false;
                };
			var ii = layer.msg(\'正在生成中...\', {icon: 16, time: 10 * 1000});
          	$.ajax({
				type : "POST",
				url : "../fhapi.php",
				data : {"longurl":longurl,"type":type,"api":api,"sbm":sbm,"title":title},
				dataType : \'json\',
			success: function(data) {
             if (data.code == 1) {
               layer.msg("生成完毕！点链接自动复制", {
                    icon: 6
                });
                $(\'#urllj\').html(\'<hr><blockquote class="layui-elem-quote layui-text">防洪链接: <a id="content" onclick="copyContent()">\'+data.haohao_api+\'</a></blockquote>\');
            }else{
                layer.msg(data.msg, {shadeClose:true,icon: 5,anim: 6});
            }    
            layer.close(ii)
        }, error: function () {
            layer.msg(\'服务器错误！\', {shadeClose:true,icon: 5,anim: 6});
            layer.close(ii);
        }
			});
}
$("select[name=\'api\']").change(function(){
	if($(this).val() == "1"){
		$("#hyzy").css("display","inherit");
		$("#hyzyy").css("display","inherit");
		$(\'#haosm\').html(\'<blockquote class="layui-elem-quote layui-text">直链付费版，按时间收费，跳转/直链/缩短 识别码通用,会员不任何限制/免费限制访问次数带广告</blockquote><hr>\',"display","inherit");
	}else if($(this).val() == "2"){
        $(\'#haosm\').html(\'<blockquote class="layui-elem-quote layui-text">跳转版不支持自定义标题 带版权广告限制访问次数</blockquote><hr>\');
        $("#hyzy").css("display","none");		
        $("#hyzyy").css("display","inherit");
	}else if($(this).val() == "3"){
        $(\'#haosm\').html(\'<blockquote class="layui-elem-quote layui-text">缩短只支持跳转到源链接，不支持其它项目</blockquote><hr>\');
        $("#hyzy").css("display","none");		
        $("#hyzyy").css("display","inherit");
	}else{
	   $("#hyzy").css("display","none");	
	   $("#hyzyy").css("display","none");	
	}
});
function copyContent() {
      var content = document.getElementById(\'content\').innerHTML;
      var textArea = document.createElement("textarea");
      textArea.value = content;
      document.body.appendChild(textArea);
      textArea.select();
      document.execCommand("copy");
      document.body.removeChild(textArea);
     layer.msg(\'复制链接成功！\',{time: 1000, icon: 1});
    }
function checkAlphabet(input) {
  var value = input.value;
  value = value.replace(/[^a-zA-Z0-9]/g, \'\');
  input.value = value;
}    
function generateRandomLetters() {
      var length = Math.floor(Math.random() * 4) + 6;
      var letters = \'\';
      for (var i = 0; i < length; i++) {
        letters += String.fromCharCode(Math.floor(Math.random() * 26) + 97);
      }
      document.getElementById(\'inputBox\').value = letters;
    }
</script>
';
include_once './bottom.php';
Iub_4oMCvc:
goto bYRaC0Xkup;
yvWixbQ9c2:
exit('<script language=\'javascript\'>window.location.href=\'./login.php\';</script>');
goto GxxFRptlMZ;
GxxFRptlMZ:
goto vGJxDW1bBz;
Ig01nesFN1:
goto wK_MV1NaMb;
bYRaC0Xkup:
include_once './bottom.php';
echo '  
 <script src="';
goto lwor4XE_dr;
TGbxYgSrzr:
goto CjLZHFY47O;
HykWvGlEYI:
goto DIpbgv5CeT;
FdRGjii1l4:
echo '<div class="row">
    <div class="col-lg-12">
        <div class="card">
            <div class="card-header">
                生成记录列表
                </div>
            <div class="card-body">
                <div class="layui-elem-quote" id="blocktitle"></div>
                <form onsubmit="return searchOrder()" method="GET" class="form layui-form">
                    <div class="form-group mb-3" id="searchword">
                        <input type="text" class="form-control" name="kw" placeholder="搜索网址" value="">
                    </div>
                    <div class="form-group mb-3">
                        <button class="btn btn-outline-primary" onclick="reg()" type="submit"><i class="layui-icon layui-icon-search"></i> 搜索</button>&nbsp;
                          </div>
                </form>
            <div id="listTable"></div>
        </div>
    </div>
</div>
';
goto Iub_4oMCvc;
rH99Se0PAn:
goto djNySKQnwX;
djNySKQnwX:
echo '<div class="row">
    <div class="col-lg-12">
        <div class="card">
            <div class="card-header">
                在线生成防洪
</div>
<div class="card-body">
<div id="hyzyy" style="';
$hh = $hh ?? '';
echo $hh != 'zl' ? 'display:none;' : null;
goto PIdVL2DOxA;
PIdVL2DOxA:
echo '">
<div id="haosm"></div></div>
<div class="form-group mb-3">
<label for="example-input-normal" style="font-weight: 500">生成类型：</label>
<select name="api" class="form-control">
<option value="">请选择类型</option>
<option value="1">生成直链[推荐]</option>
<option value="2">生成跳转[稳定]</option>
<option value="3">生成短链[缩短]</option>
</select>
</div>
<div class="form-group mb-3">
<label for="example-input-normal" style="font-weight: 500">短链类型：</label>
<select class="form-control" name="type">
';
goto Q_3UNynxSk;
OvCUP_AEr2:
goto JmZb_SSN41;
lwor4XE_dr:
echo $cdnpublic;
echo 'layer/2.3/layer.js"></script>
<script src="';
echo $cdnpublic;
goto HLCcWfbexk;
Q_3UNynxSk:
$hh_duan = $DB->query('SELECT * FROM meihe_api WHERE `jktz`=\'1\'');
foreach ($hh_duan as $res) {
    echo '<option value="' . $res['sbm'] . '">' . $res['name'] . '</option>';
    rcIiqPxJfX:
    uxZdCBYmOR:
}
vMZopDESfD:
cSDd8gX7hp:
echo '</select>
</div>
<div class="form-group">
<label>生成域名:</label><br>
<input type="text" class="form-control" name="url" placeholder="请输入URL地址">
</div>
<div class="form-group mb-3">
<label for="example-input-normal" style="font-weight: 500">识别码：</label>
	 <div class="input-group">
	 <input type="text" class="form-control" name="sbm" id="inputBox" maxlength="9" pattern="[a-zA-Z]{9}" oninput="checkAlphabet(this)" placeholder="不填写则默认"/>
<span class="input-group-btn"><a class="btn btn-info" onclick="generateRandomLetters()">随机</a></span>
</div>
</div>
<div id="hyzy" style="';
goto OvCUP_AEr2;
wK_MV1NaMb:
vGJxDW1bBz:
$my = isset($_GET['mod']) ? $_GET['mod'] : null;
if (!($my == 'scurl')) {
    goto wFF6tVAkKB;
}
goto rH99Se0PAn;
wFF6tVAkKB:
goto ZfasU5xqWf;
HLCcWfbexk:
goto TGbxYgSrzr;
JmZb_SSN41:
echo $hh != 0x001 ? 'display:none;' : null;
echo '">
<div class="form-group">
<label>站点标题:</label><br>
<input type="text" class="form-control" name="bt" placeholder="网站标题,不填写则默认">
</div>
</div>
<div id="urllj"><blockquote class="layui-elem-quote layui-text">还未提交生成..</blockquote></div>
 <button type="submit" onclick="addduanl()" class="btn btn-block btn-xs btn-outline-success" >立即生成</button>
</form>
<br>
<a href="./generate.php">>>返回生成列表</a>
</div>
</div>
</div>
<script src="';
echo $cdnpublic;
goto M1S9Gt54NF;
CjLZHFY47O:
echo 'clipboard.js/1.7.1/clipboard.min.js"></script>
<script type="text/javascript">
function selectAll(checkbox) {
    $(\'input[type=checkbox]\').prop(\'checked\', $(checkbox).prop(\'checked\'));
}
function listTable(query){
    var url = window.document.location.href.toString();
    var queryString = url.split("?")[1];
    query = query || queryString;
    if(query == \'start\' || query == undefined){
        query = \'\';
        history.replaceState({}, null, \'./generate.php\');
    }else if(query != undefined){
        history.replaceState({}, null, \'./generate.php?\'+query);
    }
    layer.closeAll();
    var ii = layer.msg(\'正在加中,请稍后...\', {icon: 16, time: 10 * 1000});
    $.ajax({
        type : \'GET\',
        url : \'sclb-table.php?\'+query,
        dataType : \'html\',
        cache : false,
        success : function(data) {
            layer.close(ii);
            $("#listTable").html(data)
        },
        error:function(data){
            layer.msg(\'服务器错误\', {icon: 5});
            return false;
        }
    });
}
function searchOrder(){
    var type=$("select[name=\'type\']").val();
    var kw=$("input[name=\'kw\']").val();
    var method=$("select[name=\'method\']").val();
    if(kw==\'\'){
        listTable(\'start\');
    }else{
        listTable(\'type=\'+type+\'&kw=\'+kw+\'&method=\'+method);
    }
    return false;
}
function searchClear(){
    $("select[name=\'type\']").val(0);
    $("input[name=\'kw\']").val(\'\');
    $("select[name=\'method\']").val(0);
    listTable(\'start\');
}
function change(){
  if($("select[name=\'aid\']").val() == 3 && $("input[name=\'content\']").val()==\'\'){
        layer.prompt({title: \'请输入修改标题\', formType: 2}, function(text, index){
            layer.close(index);
            $("input[name=\'content\']").val(text);
            change()
        });
        return false;
    }
    var ii = layer.msg(\'正在操作中,请稍后...\', {icon: 16, time: 10 * 1000});
    $.ajax({
        type : \'POST\',
        url : \'ajax.php?act=scjlgl\',
        data : $(\'#form1\').serialize(),
        dataType : \'json\',
        success : function(data) {
            layer.close(ii);
            if(data.code == 0){
                layer.msg(data.msg, {
                    icon: 6,
                    end: function (layero, index) {
                        listTable();
                    }
                });
            } else {
                layer.msg(data.msg, {icon: 5});
            }
        },
        error:function(data){
            layer.msg(\'请求超时\', {icon: 5});
        }
    });
    return false;
}
$(document).ready(function(){
    var items = $("select[default]");
    for (i = 0; i < items.length; i++) {
        $(items[i]).val($(items[i]).attr("default")||0);
    }
    listTable();
})
function recharge(id){
    var body=\'<div class="form-group"><input type="text" id="bt" placeholder="请输修改标题" class="form-control">\';
    layer.confirm(body,{title:"修改标题",btn: [\'确定\',\'取消\']}, function(){
        var title=$("#bt").val();
        if(title==\'\'){
            layer.msg(\'请输入标题\', {icon: 5});
            return false;
        }
        var ii = layer.msg(\'正在操作中,请稍后...\', {icon: 16, time: 10 * 1000});
        $.ajax({
            type : "POST",
            url : "ajax.php?act=user_recharge",
            data : {id:id,title:title},
            dataType : \'json\',
            success : function(data) {
                layer.close(ii);
                if(data.code == 0){
                    layer.msg(\'修改标题成功!\', {
                        icon: 6,
                        end: function (layero, index) {
                            listTable();
                        }
                    });
                } else {
                    layer.msg(data.msg, {icon: 5});
                }
            },
            error:function(data){
                layer.close(ii);
                layer.msg(\'服务器错误\', {icon: 5});
                return false;
            }
        });
    });
}
</script>';
